public class BSTNode<K extends Comparable<K>, V> {
	private K key;
	private V value;
	private BSTNode<K, V> left;
	private BSTNode<K, V> right;
	int height;
	int bf;

	public BSTNode(K key, V value) {
		this.key = key;
		this.value = value;
		height = 0;
		bf = 0;
	}
	
	public BSTNode(K key, V value, int height, int bf) {
		this.key = key;
		this.value = value;
		this.height=height;
		this.bf=bf;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getBf() {
		return bf;
	}

	public void setBf(int bf) {
		this.bf = bf;
	}

	public K getKey() {
		return key;
	}

	public void setKey(K key) {
		this.key = key;
	}

	public V getValue() {
		return value;
	}

	public void setValue(V value) {
		this.value = value;
	}

	public BSTNode<K, V> getLeft() {
		return left;
	}

	public void setLeft(BSTNode<K, V> left) {
		this.left = left;
	}

	public BSTNode<K, V> getRight() {
		return right;
	}

	public void setRight(BSTNode<K, V> right) {
		this.right = right;
	}

	public String toString() {
		String keyStr = "";
		String valStr = "";
		
		if(key!=null){keyStr=key.toString();}
		
		if(value!=null){valStr=value.toString();}
		
		return "<"+keyStr + ", "+valStr+"> ";
	}
}